Contents | Index | < Browse | Browse >

LETTERfwriteULETTER Writes data blocks to a file.

Overview
#include <stdio.h>

r = fwrite(ptr,size,n,f);

unsigned int r;
const void *ptr;
unsigned int size;
unsigned int n;
FILE *f;

Portability
ANSI

Description
"fwrite" is the opposite to "fread": it writes "n" blocks of the size "size" to the file referred to by "f". The data is taken from the memory location "ptr".

Returns
The number of written objects. If an error occured, this number will be smaller than "n".